Boduka Codes taken from Nov, 2000
EVADE
// carchoth - 12.1.97 - minor typo corrections
/*
* Date Creator Comment
* ------------ --------------- -----------------------------------------
* 11 May 96 Agamemnon Modified to use new skill hierarchy
* 14 Dec 97 Hellbent Typo-fixed the help file up.
* 19 Mar 98 Darsis Not stackable with Vapours
* 24 Jan 00 Hawk changed to be a duration shield using defenses
*/
/* Coded by Akira */
#include
inherit CMD_BASE;
#include
#define MIN_LVL 101
#define BIG_LVL 161
#define GP_COST 200
#define FACTOR1 25
#define SKILL1_USED "fighting.combat.dodging"
#define SKILL2_USED "covert.stealth"
#define DEFENSE "/cmds/guild/budoka/defense/evade_def"
int query_valid_use( object ob )
{
if( !ob->query_property( "com_list" ) ||
ob->query_property( "com_list" )["fifth"]
!= "evade" ) return 0;
return 1;
}
string help()
{
return "Syntax: evade\n\n"+
"The evade action gives you the ability to use special"
" techniques from your budoka training, to escape or reduce damage"
" from attacks. This skill is affected by your "+SKILL1_USED+
" and "+SKILL2_USED+" skill bonuses. To finish an evasive maneuver,"
" type `dispel evade'.\n";
}
protected int cmd( class command cmd )
{
int level, skill, duration, rating;
int gpcost,minlvl;
object actor;
if( !query_valid_use( cmd->user ) ) return 0;
if( cmd->user->query_guild() != "budoka" )
{
tell_object(cmd->user,"You don't have the proper background.\n");
return 0;
}
if( cmd->arg == "help" )
{
tell_object( cmd->user, help() );
return 1;
}
actor = cmd->user;
level = actor->query_skill( SKILL2_USED );
skill = (int)actor->query_skill_bonus(SKILL1_USED);
skill += (int)actor->query_skill_bonus(SKILL2_USED);
rating = skill / FACTOR1;
duration = skill / 2;
if( rating > 50 ) rating = 50;
if (level < MIN_LVL) {
tell_object(cmd->user,"You are level "+level+" in this skill, and "
"you need "+ minlvl +".\n");
tell_object(cmd->user,"You are not skilled enough to even try such a
risky combat
maneuver.\n");
return 1;
}
if( actor->query_casting_spell( "shield" ) &&
( strsrch( actor->query_casting_spell( "shield" ), "evade_def" ) + 1 ) )
{
tell_object(cmd->user,"You are already conducting an evasive
maneuver!\n");
return 1;
}
if( actor->query_defense( "shield" ) )
{
tell_object(cmd->user,"A dweomer placed upon you interfered with "
"your ability to evade.\n");
return 1;
}
gpcost = GP_COST;
if((int)actor->adjust_gp(-gpcost) == -1) {
tell_object(cmd->user,"You lack sufficient guild points to evade at "
"the moment.\n");
return 1;
}
if( actor->query_casting_spell( "evade" ) )
{
tell_object(cmd->user, "You have already begun your evasive "
"maneuver.\n" );
return 1;
}
tell_object(cmd->user, "You begin to concentrate.\n" );
actor->add_effect( base_name( TO ), ({ actor, duration, rating }), "evade"
);
return 1;
}
int effect_heart_beat( object stuff, mixed params )
{
object dude;
dude = params[0];
if( !dude ) return REMOVE_THIS_EFFECT;
params[0]->add_defense( DEFENSE->query_name(), DEFENSE, ({ ({ params[2],
params[2] }) }), 85 );
DEFENSE->set_this_time( dude, params[1] );
return dude->remove_effect( "evade" );
}
int query_heart_beat_frequency() { return 1; }